package com.mediacloud.app.newsmodule.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
/**
 * 音频直播的广播
 * @author x
 *
 */
public class AudioLiveBroadcast extends BroadcastReceiver
{

	public static final String Audio_UpdateTime="AudioLive_UpdateTime";
	public static final String AudioComplete="AudioLiveComplete";
	public static final String TOGGLE_AUDIO ="toggle_live_audio";
	public AudioLiveBroad audioLiveBroadHanlder;
	public boolean registed;
	@Override
	public void onReceive(Context context, Intent intent) 
	{
		if(audioLiveBroadHanlder!=null)
		{
			String action=intent.getAction();
			if(Audio_UpdateTime.equals(action))
				audioLiveBroadHanlder.updateCurrentTime(intent);
			else if(AudioComplete.equals(action))
				audioLiveBroadHanlder.audioComplete(intent);
			else if(TOGGLE_AUDIO.equals(action)){
				audioLiveBroadHanlder.togglePauseAudio(intent);
			}
		}
	}
	/**
	 * 音频直播
	 * @author x
	 *
	 */
	public interface AudioLiveBroad
	{
		void updateCurrentTime(Intent intent);
		void audioComplete(Intent intent);
		void togglePauseAudio(Intent intent);
	}

}